package ltd.dujiabao.capability.adapter.driving.restful;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import ltd.dujiabao.capability.application.capmng.CapabilityService;
import ltd.dujiabao.capability.application.capmng.SyncCapabilityDTO;
import ltd.dujiabao.capability.common.dto.ErrorCodes;
import ltd.dujiabao.capability.common.dto.Result;

/**
 * @author : DuJiabao
 * @Project : ddd-capability
 * @Time : 2024/4/6 23:15
 * @Desc :
 */
@RestController
public class CapabilityController {

    @Autowired
    private CapabilityService capabilityService;

    @RequestMapping("syncCapability")
    public Result<Object> syncCapability(@Validated @RequestBody SyncCapabilityDTO dto) {
        capabilityService.syncCapability(dto);
        return new Result<>(ErrorCodes.SUCCESS.getCode());
    }
}
